// plugin.cpp

#include "plugin.h"

// unique identifier for our new plugin
#define EXPORT_PLUGIN_CLASS_ID	Class_ID(0xe2a0ab1, 0xa236bea)
#define ANIMATION_PLUGIN_CLASS_ID Class_ID(0x28ad713b, 0x23726bd9)

extern HINSTANCE hinstance;

// SceneyExportPlugin class implementation
SceneyExportPlugin::SceneyExportPlugin()
{

}


SceneyExportPlugin::~SceneyExportPlugin()
{
}


// Methods required for the plugin

// Number of extemsions supported
int	SceneyExportPlugin::ExtCount()
{
	return 1;
}

// Extension #n (i.e. "3DS")
const TCHAR * SceneyExportPlugin::Ext(int n)
{
	return "sceney";
}

// Long ASCII description (i.e. "Autodesk 3D Studio File")
const TCHAR * SceneyExportPlugin::LongDesc()
{
	return "Sceney (Rendy renderer scene file)";
}

// Short ASCII description (i.e. "3D Studio")
const TCHAR * SceneyExportPlugin::ShortDesc()
{
	return "sceney";
}

// ASCII Author name
const TCHAR * SceneyExportPlugin::AuthorName()
{
	return "Mihalis Georgoulopoulos";
}

// ASCII Copyright message
const TCHAR * SceneyExportPlugin::CopyrightMessage()
{
	return "This software is provided under the terms of the GNU General Public Licence.";
}

// Other message #1
const TCHAR * SceneyExportPlugin::OtherMessage1()
{
	return "";
}

// Other message #2
const TCHAR * SceneyExportPlugin::OtherMessage2()
{
	return "";
}

// Version number * 100 (i.e. v3.01 = 301)
unsigned int SceneyExportPlugin::Version()
{
	return 100;
}

// Show DLL's "About..." box
void SceneyExportPlugin::ShowAbout(HWND hWnd)
{
	MessageBox(hWnd, "Sceney scene exporter (exports scene files for the rendy renderer)", "Message", 0);
}



// Returns TRUE if all option bits set are supported for this extension
BOOL SceneyExportPlugin::SupportsOptions(int ext, DWORD options)
{
	return false;
}


// class descriptor
/////////////////////////////////////////////////////////////////////////////
class SceneyExportPluginDesc : public ClassDesc2 
{
public:
	int IsPublic()
	{
		return TRUE;
	}

	void *Create(BOOL loading = FALSE)
	{
		return new SceneyExportPlugin();
	}

	const TCHAR *ClassName()
	{
		return "SceneyExportPlugin";
	}

	SClass_ID SuperClassID()
	{
		return SCENE_EXPORT_CLASS_ID;
	}
	
	Class_ID ClassID()
	{
		return EXPORT_PLUGIN_CLASS_ID;
	}

	const TCHAR* Category()
	{
		return "Category";
	}

	const TCHAR* InternalName()
	{
		return "SceneyExportPlugin";
	}

	HINSTANCE HInstance()
	{
		return hinstance;
	}

}; // end class SceneyExportPluginDesc

static SceneyExportPluginDesc export_plugin_desc;
ClassDesc2* GetSceneyExportPluginDesc()
{
	return &export_plugin_desc;
}

// --------------------------------------------------------------------------
// animation plugin
// --------------------------------------------------------------------------
// SceneyExportPlugin class implementation
AnimeyExportPlugin::AnimeyExportPlugin()
{
}


AnimeyExportPlugin::~AnimeyExportPlugin()
{
}


// Methods required for the plugin

// Number of extemsions supported
int	AnimeyExportPlugin::ExtCount()
{
	return 1;
}

// Extension #n (i.e. "3DS")
const TCHAR * AnimeyExportPlugin::Ext(int n)
{
	return "animey";
}

// Long ASCII description (i.e. "Autodesk 3D Studio File")
const TCHAR * AnimeyExportPlugin::LongDesc()
{
	return "Animey (Rendy animation file)";
}

// Short ASCII description (i.e. "3D Studio")
const TCHAR * AnimeyExportPlugin::ShortDesc()
{
	return "ANIMEY ANIMATION";
}

// ASCII Author name
const TCHAR * AnimeyExportPlugin::AuthorName()
{
	return "Mihalis Georgoulopoulos";
}

// ASCII Copyright message
const TCHAR * AnimeyExportPlugin::CopyrightMessage()
{
	return "This software is provided under the terms of the GNU General Public Licence.";
}

// Other message #1
const TCHAR * AnimeyExportPlugin::OtherMessage1()
{
	return "";
}

// Other message #2
const TCHAR * AnimeyExportPlugin::OtherMessage2()
{
	return "";
}

// Version number * 100 (i.e. v3.01 = 301)
unsigned int AnimeyExportPlugin::Version()
{
	return 100;
}

// Show DLL's "About..." box
void AnimeyExportPlugin::ShowAbout(HWND hWnd)
{
	MessageBox(hWnd, "Animey animation exporter (exports animation files for the rendy renderer)", "Message", 0);
}



// Returns TRUE if all option bits set are supported for this extension
BOOL AnimeyExportPlugin::SupportsOptions(int ext, DWORD options)
{
	return false;
}


// class descriptor
/////////////////////////////////////////////////////////////////////////////
class AnimeyExportPluginDesc : public ClassDesc2 
{
public:
	int IsPublic()
	{
		return TRUE;
	}

	void *Create(BOOL loading = FALSE)
	{
		return new AnimeyExportPlugin();
	}

	const TCHAR *ClassName()
	{
		return "AnimeyExportPlugin";
	}

	SClass_ID SuperClassID()
	{
		return SCENE_EXPORT_CLASS_ID;
	}
	
	Class_ID ClassID()
	{
		return ANIMATION_PLUGIN_CLASS_ID;
	}

	const TCHAR* Category()
	{
		return "Category";
	}

	const TCHAR* InternalName()
	{
		return "AnimeyExportPlugin";
	}

	HINSTANCE HInstance()
	{
		return hinstance;
	}

}; // end class SceneyExportPluginDesc

static AnimeyExportPluginDesc animation_plugin_desc;
ClassDesc2* GetAnimeyExportPluginDesc()
{
	return &animation_plugin_desc;
}
